package com.syg.springboot06.readConfig.controller;

import com.syg.springboot06.readConfig.dto.CityDto;
import com.syg.springboot06.readConfig.dto.StudentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 1,读取自定义配置文件
 * 2,读取对象
 * 3,读取list
 */
@RestController
//@PropertySource(value = "classpath:syg.properties",encoding = "UTF-8")//读取自定义配置文件
public class ConfigController {

    @Autowired
    private StudentDto studentDto;//2,获取对象

    @GetMapping("/getObj")
    public String getObj() {
        return studentDto.toString();
    }


    @Autowired
    private CityDto cityDto;//3,读取list

    @GetMapping("/getList")
    public String getList() {
        return cityDto.toString();
    }
}
